<?php
namespace app\model;

use think\Model;

class MiaoshaGoods extends Model
{
    protected $connection = 'mysql';

    protected $pk = 'id';

    protected $name = 'miaosha_goods';
    public static function setGoodslist($goods)
    {
        if (!empty($goods)) {
            foreach ($goods as &$vo) {
                $goodsdata = Goods::find($vo['goods_id']);
                if (!empty($goodsdata)) {
                    $vo['goods'] = $goodsdata->toArray();
                    $vo['image'] = toimg($vo['goods']['image']);
                }
            }
        }
        return $goods;
    }
}
